#ifndef CWEAPON_H
#define CWEAPON_H

#include "CEntity.h"

class CWeapon : public CEntity
{
public:
	CWeapon();
	CWeapon( int numbullets, int spread );
	virtual ~CWeapon();

	virtual void Render();
	virtual void Update();
	virtual void Load();
	virtual void TakeDamage(float damage = 1);
	virtual void Kill();
	virtual void FireBullet();
	//virtual bool Collision( CEntity* test );
	void Attach( CEntity* ship )		{ Ship = ship; }
	void SetBulletSpeed( float bulletspeed );
	void SetBulletDamage( float damage );
	//virtual void SetSpeed( float bulletspeed );     //maybe use in the future, i'm afraid of the potentail speed decrease

	CEntity*** Bullets;	//2d array of bullet pointers. first array is bullets, second is spread
	int NumBullets;		//number of bullets in the array
	float RateOfFire;	//rate of fire for the weapon
	float FireTimer;	//firingtimer
	float ChargeTimer;  //for delayed shots, like the charge gun
	int Spread;			//number of bullets in the spread
	float SpreadAngle;	//angle difference for each bullet
	float BulletLifeSpan; //time the bullet will remain active after being fired, prevents infinite life for some bullets

	CEntity* Ship;		//ship the weapon is attached to
};


#endif